<extend name="Layout:layout_content" />
<block name="body_main">
    <div class="grid-parent xsui-page-header">
        <div class="grid-60 mobile-grid-100 grid-parent">
            <a href="{:U('customer_import')}" class="xsui-btn ui-state-default lnk-add-dialog"><i class="fa fa-upload"></i>导入Excel</a>
            <if condition="'SEAT' eq $login_data['type_name']">
                <a href="{:U('CustomerDispatch/dispatch_simple','customer_id=varkey')}" class="xsui-btn ui-state-default lnk-remove"><i class="fa fa-shopping-basket fa-fw"></i>领取</a>
                <else/>
                <a href="{:U('CustomerDispatch/dispatch_edit','customer_id=varkey')}" class="xsui-btn ui-state-default lnk-edit-dialog" title="批量分配"><i class="fa fa-edit fa-fw"></i>批量分配</a>
                <a href="{:U('Customer/customer_delete','id=varkey')}" class="xsui-btn ui-state-default lnk-remove" data-options="confirm_message:'您确定要删除{n}个客户吗?\n删除后不可恢复!'"><i class="fa fa-remove"></i>批量删除</a>
            </if>
        </div>
        <div class="grid-40 mobile-grid-100 grid-parent xsui-text-right">
            <a href="#" class="xsui-btn ui-state-default lnk-refresh"><i class="fa fa-refresh"></i>刷新</a>
            <span class="xsui-input-group">
                <form method="get">
                    <input type="text" name="search_key" value="{$search.search_key}" placeholder="编号/姓名/手机号码" />
                    <button type="submit" class="ui-state-default"><i class="fa fa-search"></i>搜索</button>
                </form>
            </span>
        </div>
    </div>
    <div id="xsui_container">
        {$content}
    </div>
</block>
<block name="body_after">
    <script type="text/javascript">
        // 发起呼叫 2016-3-25
        $('.lnk-dialout').click(function () {
            var tel = $(this).attr('href');
            // 先弹屏
            var url = $('#customer-edit-dialog-url').val();
            ifrmDialog.open_edit_dialog(url.replace('vartel', tel), {title: '来电弹屏 ' + tel}, 'screen_popup_man{n}', 'screen_popup_man', 3);
            // 再呼叫
            url = $('#dialout-url').val();
            $.get(url.replace('vartel', tel), function (data) {
                console.log(data);
                if (data.status) {

                } else {
                    alert(data.info);
                }
            })
            return false;
        })
    </script>
</block>